<template>
  <div class="right-container">
    <h3>Right 组件---- 是否全选:{{isAll}}</h3>
    <hr>

    <p>count 值：{{$store.state.count}}</p>
    <button @click="add({num:-5})" class="btn btn-warning">-1</button>
    <button @click="$store.dispatch('suAsync')" 
    class="btn btn-warning">异步-5</button>
  </div>
</template>

<script>
// import { mapMutations } from 'vuex'
// mapMutations 的使用
import {mapState,mapMutations,mapActions,mapGetters} from 'vuex'

export default {
  name: 'Right',
  computed:{
    ...mapState(['count']),
     ...mapGetters(['isAll'])
  },
  methods:{
    ...mapMutations(['add'])
   
  }
}
</script>

<style>
</style>
